<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>

</head>
</head>
<body>
<div id="app">
  <p>
  <h3>今天发钱了,发了{{Money}}</h3></p>
  <p>
  <h3>纳税{{MoneyInTax}}</h3></p>
  <p>
  <h3>上交给老婆{{MoneyChinaRMB}}</h3></p>
  <button v-on:click="btnMoney(12000)">发工资</button>
  <button v-on:click="btnMoney(10000)">发奖金</button>
</div>
<!-- 1:引包 -->
<script type="text/javascript" src="../../node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
  new Vue({
    el: "#app",
    data: function () {
      return {
        Money: 0
      }
    },
    computed: {
      MoneyInTax: {
        get: function () {
          return this.Money * 0.08
        },
        set: function (value) {
          this.Money = value
        }
      },
      MoneyChinaRMB: function (num, num1) {
        return Math.round(this.Money * 0.8)
      },
    },
    methods: {
      btnMoney: function (money) {
        this.Money = money
      }
    }
  })
</script>

</body>
</html>
